package com.itheima.demo02;

import java.io.IOException;
import java.io.InputStream;
import java.net.ServerSocket;
import java.net.Socket;

public class ServiceDemo {
    public static void main(String[] args) throws IOException {
        ServerSocket ss = new ServerSocket( 10000);

        Socket s = ss.accept();
        InputStream is = s.getInputStream();
        /*int len;
        while ((len = is.read()) != -1) {
            System.out.print((char) len);
        }*/
        byte[] bytes = new byte[1024];
        int read = is.read();
        System.out.println(new String(bytes,0,read));
        ss.close();
        is.close();
    }
}
